using System;

using System.Configuration;
namespace TimelineNet.Library {
    [Serializable()]
    public class TimelineData : System.Collections.Generic.List<Event> {

        public bool RenderAsXML = true;
        public string DataID;

        public string DataUrl {
            get {
                return dataUrl;
            }
            set {
                dataUrl = value;
            }
        }
        private string dataUrl;
        public TimelineData() {
            this.DataID = System.Guid.NewGuid().ToString();
        }
        public override string ToString() {
            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            if(RenderAsXML) {
                sb.Append("<data id=\"" + this.DataID + "\">");
                foreach(Event e in this) {
                    sb.Append(e.ToString());
                }
                sb.Append("</data>");
            } else {

            }
            return sb.ToString();
        }
    }
}